home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / elim21.arc / ELIM.DOC next >
Text File  |  1991-03-20  |  8KB  |  179 lines

  1.                                ELIM 2.1
  2.  
  3.                      Small program to delete files
  4.                        not accessible to DOS Del
  5.                                 - and -
  6.                   Avoid DEL's 'Are you sure?' prompt
  7.                               - and/or -
  8.                        Remove the subdirectory
  9.  
  10.                                   by
  11.  
  12.                                Bob Eyer
  13.                              Mar 21, 1991
  14.  
  15.                 CAUTION: Please read the WARNING below
  16.  
  17.      Syntax:
  18.  
  19.      ELIM Filespec [D]
  20.  
  21.      If D is specified on the command line and the  Filespec  indicates
  22.      deletion  of  all  files  in the subdirectory defined by Filespec,
  23.      then ELIM will attempt to remove that subdirectory after all files
  24.      are deleted.  If some  files  (e.g.   read  only)  remain  in  the
  25.      subdirectory,  or  if  it  contains  other  subdirectories, ELIM's
  26.      attempt will not be successful, and will report the status of  the
  27.      attempt at the end of the run, returning a DOS error level of 1.
  28.  
  29.      Discussion:
  30.      ----------
  31.      The  new features of ELIM in version 2.1 have led to a substantial
  32.      alteration of its scope and purpose.  The main purpose of the  new
  33.      ELIM  is to enable deletion of files and directories in which they
  34.      were  formerly  located  with  an  absolute  minimum   number   of
  35.      keystrokes.   ELIM  will  also  handle deletion of files which DOS
  36.      cannot access, but the method by which it does this  is  different
  37.      from the procedure in previous versions.
  38.  
  39.      Formerly, ELIM allowed statements like
  40.  
  41.      ELIM A B
  42.  
  43.      to eliminate or delete a file  with the  invalid  filename  'A B'.
  44.      This  type  of  statement  is no longer supported.  To achieve the
  45.      required effect, the following syntax must be used:
  46.  
  47.      ELIM 'A B'
  48.  
  49.      The  reason  why  this  new syntax is needed is that an additional
  50.      option has been added to the command line, and some means must  be
  51.      provided  to prevent ELIM from interpreting this additional option
  52.      as part of an invalid filename.
  53.  
  54.      ELIM  2.1  always  reports on the screen what it did to each file,
  55.      and will present a count of the number of files deleted,  so  that
  56.      proper  control can be maintained.  Deleted files are displayed in
  57.      'wide' format, so as to make the best use of screen space.
  58.  
  59.      Advantages:
  60.      ----------
  61.      ELIM does not prompt the user for confirmation, where  a  wildcard
  62.      is  used.  Thus, it is unnecessary to pipe a "y" to DEL in a batch
  63.      file.  Just use ELIM.
  64.  
  65.      ELIM supports all DOS wildcard shortcuts.   For  example,  if  one
  66.      wishes  to  delete all the files in the TEST directory, one can do
  67.      that simply by issuing the command
  68.  
  69.      ELIM TEST    (equivalent to 'ELIM TEST\.' and ELIM TEST\*.*'
  70.  
  71.      The following are also legitimate:
  72.  
  73.      ELIM .
  74.      ELIM ..\.
  75.  
  76.      New:
  77.      ---
  78.      ELIM  now takes advantage of DOS's path defaults.  For example, if
  79.      you are in C:\WORK and then transfer to  drive  D:  without  first
  80.      returning  to  the root directory of C:, DOS will remember WORK as
  81.      the default directory of C:.  The new version of ELIM is  designed
  82.      to  detect  the  default  DOS path of other drives.  So, if you've
  83.      left C: in directory WORK and are now on D:,
  84.  
  85.      ELIM C:
  86.  
  87.      will  delete  all  read/write files in C:\WORK and ignore all read
  88.      only files in that directory.
  89.  
  90.      The same trick also applies to subdirectories of the other drive's
  91.      default   path.    For   example,  there  may  have  been  an  ABC
  92.      subdirectory of C:\WORK at the time you left C: for D: and you now
  93.      wish to delete all the files in that subdirectory from D:, as well
  94.      as remove that subdirectory.  This can  be  done  by  issuing  the
  95.      following command:
  96.  
  97.      ELIM C:ABC D
  98.  
  99.      Notice the absence of  the  backslash.   DOS  interprets  commands
  100.      issued  without  the backslash prefix as commanding it to make use
  101.      of DOS default path information.  The command in the example  only
  102.      deletes  the  files  contained  in  C:\WORK\ABC  and  then removes
  103.      C:\WORK\ABC, leaving C:\WORK intact.
  104.  
  105.      NOTE: The following command, with this example, will NOT work:
  106.  
  107.      ELIM C: D
  108.  
  109.      The  obvious purpose here is to remove the WORK directory by using
  110.      DOS's path default.  However, this cannot work, since DOS does not
  111.      permit removing a directory when the user is IN that directory.
  112.  
  113.      If you're in WORK\B and there is an A subdirectory  of  WORK,  you
  114.      can  delete  all  read-write files in the A subdirectory from your
  115.      present B subdirectory by issuing the following command:
  116.  
  117.      ELIM ..\A
  118.  
  119.      You  may  also  have  ELIM  remove  ..\A  after  all files deleted
  120.      automatically.   Provided  ..\A   does   not   itself   have   any
  121.      subdirectories or read only files, this can be done by issuing the
  122.      following command:
  123.  
  124.      ELIM ..\A D
  125.  
  126.  
  127.      Errors:
  128.      ------
  129.      Error responses always return a DOS error level of 1.
  130.  
  131.      If  the  user  specifies  a filename or wildcard to which no files
  132.      correspond, ELIM will return the message "No such file(s)" and  an
  133.      error  level  of 1.  If nothing is mentioned as a parameter on the
  134.      commandline, ELIM will return to the user a small help screen  and
  135.      an error level of 1.
  136.  
  137.      ELIM will accommodate a maximum of 32 undeleted files; if you have
  138.      a directory containing more than 32 read only files (or hidden  or
  139.      system),  ELIM  2.1 will automatically stop making a record of the
  140.      excess  beyond  32,  will  note  this  situation  at  termination,
  141.      returning  an  error level of 1.  In these circumstances, however,
  142.      ELIM will nonetheless  delete  all  read-write  files  in  such  a
  143.      directory, no matter how large it is.
  144.  
  145.      All other ELIM terminations return an error level of 0.
  146.  
  147.      ELIM's  error  level  returns  make  it  possible  to  use ELIM in
  148.      automated batch file programs.
  149.  
  150.      WARNING:
  151.      -------
  152.      Avoid  using ELIM in preference to DOS DEL, unless you really know
  153.      what you are doing.  The designers of DOS deliberately put in  the
  154.      'Are  you  sure?' prompt on the DEL command for a reason, and that
  155.      reason is that it's better to be safe than sorry.
  156.  
  157.      Because ELIM focusses  on  minimising  keystrokes  and  on  taking
  158.      advantage  of  DOS's  natural  defaults as much as possible, it is
  159.      very easy to use ELIM in such a way as to do a lot of damage  that
  160.      you  may  not intend.  DO NOT USE THIS PROGRAM ON REAL CASES UNTIL
  161.      AFTER YOU'VE RUN IT EXPERIMENTALLY ON A  DOZEN  EXAMPLES  SUCH  AS
  162.      THOSE INDICATED ABOVE.
  163.  
  164.      DISCLAIMER:
  165.      ==========
  166.      This program is circulated as public domain without any  guarantee
  167.      or  warranty;  and  the  user, by downloading this program, or any
  168.      variant thereof or by receiving it or any of its versions  in  any
  169.      other  form, agrees to accept full responsibility for its use.  It
  170.      is therefore understood that the user accepts this program or  any
  171.      previous  version  as  is.
  172.  
  173.      Bob Eyer                  The author may also be reached at
  174.      Compuserve [73230,2620]   ROSE MEDIA 416-733-2285 (Main Conf)
  175.      Toronto                   or
  176.      Canada                    CANADA REMOTE 416-629-7044 (IBM Conf)
  177.      -------------------------------------------------------------
  178.      End of documentation.
  179.